import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const updatePwd = r => require.ensure([], () => r(require('@/page/updatePwd')), 'updatePwd');


const login = r => require.ensure([], () => r(require('@/page/login')), 'login');
const changeClass = r => require.ensure([], () => r(require('@/page/changeClass')), 'changeClass');
const manage = r => require.ensure([], () => r(require('@/page/manage')), 'manage');
const home = r => require.ensure([], () => r(require('@/page/home')), 'home');
const addShop = r => require.ensure([], () => r(require('@/page/addShop')), 'addShop');
const addGoods = r => require.ensure([], () => r(require('@/page/addGoods')), 'addGoods');
const userList = r => require.ensure([], () => r(require('@/page/userList')), 'userList');
const employeeList = r => require.ensure([], () => r(require('@/page/employeeList')), 'employeeList');
const addStudent = r => require.ensure([], () => r(require('@/page/addStudent')), 'addStudent');
const shopList = r => require.ensure([], () => r(require('@/page/shopList')), 'shopList');
const foodList = r => require.ensure([], () => r(require('@/page/foodList')), 'foodList');
const orderList = r => require.ensure([], () => r(require('@/page/orderList')), 'orderList');
const adminList = r => require.ensure([], () => r(require('@/page/adminList')), 'adminList');
const visitor = r => require.ensure([], () => r(require('@/page/visitor')), 'visitor');
const newMember = r => require.ensure([], () => r(require('@/page/newMember')), 'newMember');
const uploadImg = r => require.ensure([], () => r(require('@/page/uploadImg')), 'uploadImg');
const vueEdit = r => require.ensure([], () => r(require('@/page/vueEdit')), 'vueEdit');
const adminSet = r => require.ensure([], () => r(require('@/page/adminSet')), 'adminSet');
const sendMessage = r => require.ensure([], () => r(require('@/page/sendMessage')), 'sendMessage');
const explain = r => require.ensure([], () => r(require('@/page/explain')), 'explain');

const schoolList = r => require.ensure([], () => r(require('@/page/schoolList')), 'schoolList');
const periodList = r => require.ensure([], () => r(require('@/page/periodList')), 'periodList');
const balanceItemList = r => require.ensure([], () => r(require('@/page/balanceItemList')), 'balanceItemList');
const balanceTypeList = r => require.ensure([], () => r(require('@/page/balanceTypeList')), 'balanceTypeList');
const changeClassList = r => require.ensure([], () => r(require('@/page/changeClassList')), 'changeClassList');
const changeClassLogs = r => require.ensure([], () => r(require('@/page/changeClassLogs')), 'changeClassLogs');
const giftList = r => require.ensure([], () => r(require('@/page/giftList')), 'giftList');
const addGift = r => require.ensure([], () => r(require('@/page/addGift')), 'addGift');
const checkworkList = r => require.ensure([], () => r(require('@/page/checkworkList')), 'checkworkList');
const mySchoolInfo = r => require.ensure([], () => r(require('@/page/mySchoolInfo')), 'mySchoolInfo');
const studLeaveList = r => require.ensure([], () => r(require('@/page/studLeaveList')), 'studLeaveList');
const subjectList = r => require.ensure([], () => r(require('@/page/subjectList')), 'subjectList');
const addCheckWork = r => require.ensure([], () => r(require('@/page/addCheckWork')), 'addCheckWork');
const addEmployee = r => require.ensure([], () => r(require('@/page/addEmployee')), 'addEmployee');
const addSchool = r => require.ensure([], () => r(require('@/page/addSchool')), 'addSchool');
const addSubject = r => require.ensure([], () => r(require('@/page/addSubject')), 'addSubject');
const addPeriod = r => require.ensure([], () => r(require('@/page/addPeriod')), 'addPeriod');
const norule = r => require.ensure([], () => r(require('@/page/norule')), 'norule');


const employeeMonthList = r => require.ensure([], () => r(require('@/page/employeeMonthList')), 'employeeMonthList');
const employeeMonthTotal = r => require.ensure([], () => r(require('@/page/employeeMonthTotal')), 'employeeMonthTotal');
const employeeWeekList = r => require.ensure([], () => r(require('@/page/employeeWeekList')), 'employeeWeekList');
const employeeWeekTotal = r => require.ensure([], () => r(require('@/page/employeeWeekTotal')), 'employeeWeekTotal');
const addEmployeeMonthTotal = r => require.ensure([], () => r(require('@/page/addEmployeeMonthTotal')), 'addEmployeeMonthTotal');
const addEmployeeWeekTotal = r => require.ensure([], () => r(require('@/page/addEmployeeWeekTotal')), 'addEmployeeWeekTotal');
const chargeFeeList = r => require.ensure([], () => r(require('@/page/chargeFeeList')), 'chargeFeeList');
const chargeFeeEdit = r => require.ensure([], () => r(require('@/page/chargeFeeEdit')), 'chargeFeeEdit');
const addBalanceItem = r => require.ensure([], () => r(require('@/page/addBalanceItem')), 'addBalanceItem');
const addBalanceType = r => require.ensure([], () => r(require('@/page/addBalanceType')), 'addBalanceType');
const allEmployeeWeekTotal = r => require.ensure([], () => r(require('@/page/allEmployeeWeekTotal')), 'allEmployeeWeekTotal');
const chargeFeeDetailList = r => require.ensure([], () => r(require('@/page/chargeFeeDetailList')), 'chargeFeeDetailList');

const otherChargeFeeList = r => require.ensure([], () => r(require('@/page/otherChargeFeeList')), 'otherChargeFeeList');
const addOtherChargeFee = r => require.ensure([], () => r(require('@/page/addOtherChargeFee')), 'addOtherChargeFee');
const otherChargeList = r => require.ensure([], () => r(require('@/page/otherChargeList')), 'otherChargeList');

const usermanage = r => require.ensure([], () => r(require('@/page/usermanage')), 'usermanage');
const employeeManage = r => require.ensure([], () => r(require('@/page/employeeManage')), 'employeeManage');
const employeetotalManage = r => require.ensure([], () => r(require('@/page/employeetotalManage')), 'employeetotalManage');
const otherChargeManage = r => require.ensure([], () => r(require('@/page/otherChargeManage')), 'otherChargeManage');
const financeManage = r => require.ensure([], () => r(require('@/page/financeManage')), 'financeManage');

const publicManage = r => require.ensure([], () => r(require('@/page/publicManage')), 'publicManage');
const subjectManage = r => require.ensure([], () => r(require('@/page/subjectManage')), 'subjectManage');
const schoolManage = r => require.ensure([], () => r(require('@/page/schoolManage')), 'schoolManage');
const periodManage = r => require.ensure([], () => r(require('@/page/periodManage')), 'periodManage');

const checkWorkManage = r => require.ensure([], () => r(require('@/page/checkWorkManage')), 'checkWorkManage');
const changeSchoolManage = r => require.ensure([], () => r(require('@/page/changeSchoolManage')), 'changeSchoolManage');
const checkWorkWeekList = r => require.ensure([], () => r(require('@/page/checkWorkWeekList')), 'checkWorkWeekList');
const checkWorkMonthList = r => require.ensure([], () => r(require('@/page/checkWorkMonthList')), 'checkWorkMonthList');

const changeClassOper = r => require.ensure([], () => r(require('@/page/changeClassOper')), 'changeClassOper');

const checkListOfUser = r => require.ensure([], () => r(require('@/page/checkListOfUser')), 'checkListOfUser');
const updateStudent=r => require.ensure([], () => r(require('@/page/updateStudent')), 'updateStudent');
const feeprint=r => require.ensure([], () => r(require('@/page/feeprint')), 'feeprint');
const otherChargeprint=r => require.ensure([], () => r(require('@/page/otherChargeprint')), 'otherChargeprint');
const usercharge=r => require.ensure([], () => r(require('@/page/usercharge')), 'usercharge');

const thescorelist=r => require.ensure([], () => r(require('@/page/thescorelist')), 'thescorelist');
const customerConsume=r => require.ensure([], () => r(require('@/page/customerConsume')), 'customerConsume');




const routes = [
    {
        path: '/',
        component: login
    },
    {
        path: '/manage',
        component: manage,
        name: '',
        children: [{
            path: '',
            component: userList,
            meta: [],
        },{
            path: '/addEmployee',
            component: addEmployee,
            meta: ['会员管理', '新增客户'],
        }, {
            path: '/updatePwd',
            component: updatePwd,
            meta: ['密码管理', '密码管理'],
        }, {
            path: '/thescorelist',
            component: thescorelist,
            name:'/thescorelist',
            meta: ['积分管理', '积分列表'],
        },{
            path: '/customerConsume',
            component: customerConsume,
            name:'/customerConsume',
            meta: ['积分管理', '客户购买'],
        },{
            path: '/norule',
            component: norule,
            name:'/norule',
            meta: ['权限', '没有权限'],
        },
            {
            path: '/checkListOfUser',
            component: checkListOfUser,
            name:'/checkListOfUser',
            meta: ['考勤', '用户考勤'],
        },
            {
                path: '/updateStudent',
                component: updateStudent,
                meta: ['考勤', '用户考勤'],
            },
            {
                path: '/usercharge',
                name:'/usercharge',
                component: usercharge,
                meta: ['考勤', '用户考勤'],
            },
            {
                path: '/feeprint',
                component: feeprint,
                name:'/feeprint',
                meta: ['考勤', '用户考勤'],
            },
            {
                path: '/otherChargeprint',
                component: otherChargeprint,
                name:'/otherChargeprint',
                meta: ['考勤', '用户考勤'],
            },


            {
                path: '/checkWorkWeekList',
                component: checkWorkWeekList,
                meta: ['添加数据', '添加商铺'],
            }, {
                path: '/checkWorkMonthList',
                component: checkWorkMonthList,
                meta: ['添加数据', '添加商铺'],
            }, {
                path: '/checkWorkManage',
                component: checkWorkManage,
                meta: ['添加数据', '添加商铺'],
            }, {
                path: '/changeSchoolManage',
                component: changeSchoolManage,
                meta: ['添加数据', '添加商铺'],
            }, {
                path: '/periodManage',
                component: periodManage,
                meta: ['课时管理', '课时管理'],
            }, {
                path: '/employeeManage',
                component: employeeManage,
                meta: ['添加数据', '添加商铺'],
            }, {
                path: '/employeetotalManage',
                component: employeetotalManage,
                meta: ['添加数据', '添加商铺'],
            }, {
                path: '/otherChargeManage',
                component: otherChargeManage,
                meta: ['添加数据', '添加商铺'],
            }, {
                path: '/financeManage',
                component: financeManage,
                meta: ['添加数据', '添加商铺'],
            }, {
                path: '/publicManage',
                component: publicManage,
                meta: ['添加数据', '添加商铺'],
            }, {
                path: '/subjectManage',
                component: subjectManage,
                meta: ['添加数据', '添加商铺'],
            }, {
                path: '/schoolManage',
                component: schoolManage,
                meta: ['添加数据', '添加商铺'],
            }, {
                path: '/usermanage',
                component: usermanage,
                meta: ['添加数据', '添加商铺'],
            }, {
                path: '/addGift',
                component: addGift,
                meta: ['添加数据', '添加商铺'],
            }, {
                path: '/otherChargeList',
                component: otherChargeList,
                meta: ['添加数据', '添加商铺'],
            }, {
                path: '/otherChargeFeeList',
                component: otherChargeFeeList,
                meta: ['收支管理', '收支列表'],
            }, {
                path: '/addOtherChargeFee',
                component: addOtherChargeFee,
                meta: ['收支管理', '添加收支'],
            }, {
                path: '/chargeFeeDetailList',
                component: chargeFeeDetailList,
                meta: ['学费', '学费明细'],
            }, {
                path: '/allEmployeeWeekTotal',
                component: allEmployeeWeekTotal,
                meta: ['教师统计', '批量教师周统计'],
            }, {
                path: '/employeeMonthList',
                component: employeeMonthList,
                meta: ['教师统计', '教师月列表'],
            }, {
                path: '/employeeMonthTotal',
                component: employeeMonthTotal,
                meta: ['教师统计', '教师月列表'],
            }, {
                path: '/employeeWeekList',
                component: employeeWeekList,
                meta: ['教师统计', '教师周列表'],
            }, {
                path: '/employeeWeekTotal',
                component: employeeWeekTotal,
                meta: ['教师统计', '教师周统计'],
            }, {
                path: '/addEmployeeMonthTotal',
                component: addEmployeeMonthTotal,
                meta: ['教师统计', '添加教师月统计'],
            }, {
                path: '/addEmployeeWeekTotal',
                component: addEmployeeWeekTotal,
                meta: ['教师统计', '添加教师周统计'],
            }, {
                path: '/addBalanceItem',
                component: addBalanceItem,
                meta: ['收支管理', '添加收支项目'],
            }, {
                path: '/addBalanceType',
                component: addBalanceType,
                meta: ['收支管理', '添加收支类别'],
            }, {
                path: '/addPeriod',
                component: addPeriod,
                meta: ['课时管理', '添加课时'],
            }, {
                path: '/addSubject',
                component: addSubject,
                meta: ['科目管理', '添加科目'],
            }, {
                path: '/addSchool',
                component: addSchool,
                meta: ['学校管理', '添加学校'],
            }, , {
                path: '/addCheckWork',
                component: addCheckWork,
                meta: ['添加数据', '添加商铺'],
            }, {
                path: '/subjectList',
                component: subjectList,
                meta: ['科目管理', '科目列表'],
            }, {
                path: '/schoolList',
                component: schoolList,
                meta: ['学校管理', '学校列表'],
            }, {
                path: '/periodList',
                component: periodList,
                meta: ['课时管理', '课时列表'],
            }, {
                path: '/balanceItemList',
                component: balanceItemList,
                meta: ['收支管理', '收支项目列表'],
            }, {
                path: '/balanceTypeList',
                component: balanceTypeList,
                meta: ['收支管理', '收支类别列表'],
            }, {
                path: '/changeClassList',
                component: changeClassList,
                meta: ['换班管理', '换班列表'],
            }, {
                path: '/changeClassLogs',
                component: changeClassLogs,
                meta: ['换班管理', '换班记录'],
            }, {
                path: '/giftList',
                component: giftList,
                meta: ['赠品管理', '赠品列表'],
            }, {
                path: '/checkworkList',
                component: checkworkList,
                meta: ['考勤管理', '考勤列表'],
            }, {
                path: '/mySchoolInfo',
                component: mySchoolInfo,
                meta: ['学校管理', '我的学校信息'],
            }, {
                path: '/studLeaveList',
                component: studLeaveList,
                meta: ['考勤管理', '学生请假管理'],
            }, {
                path: '/addShop',
                component: addShop,
                meta: ['添加数据', '添加商铺'],
            }, {
                path: '/addGoods',
                component: addGoods,
                meta: ['添加数据', '添加商品'],
            }, {
                path: '/addStudent/:usertype',
                name:'addStudent',
                component: addStudent,
                meta: ['添加学生', '添加学生'],
            }, {
                path: '/userList',
                component: userList,
                meta: ['学生管理', '学生列表'],
            }, {
                path: '/employeeList',
                component: employeeList,
                meta: ['会员管理', '会员列表'],
            }, {
                path: '/changeClass',
                component: changeClass,
                meta: ['学生管理', '学生转课'],
            }, {
                path: '/shopList',
                component: shopList,
                meta: ['数据管理', '商家列表'],
            }, {
                path: '/foodList',
                component: foodList,
                meta: ['数据管理', '食品列表'],
            }, {
                path: '/orderList',
                component: orderList,
                meta: ['数据管理', '订单列表'],
            }, {
                path: '/adminList',
                component: adminList,
                meta: ['数据管理', '管理员列表'],
            }, {
                path: '/visitor',
                component: visitor,
                meta: ['图表', '用户分布'],
            }, {
                path: '/newMember',
                component: newMember,
                meta: ['图表', '用户数据'],
            }, {
                path: '/uploadImg',
                component: uploadImg,
                meta: ['文本编辑', 'MarkDown'],
            }, {
                path: '/vueEdit',
                component: vueEdit,
                meta: ['编辑', '文本编辑'],
            }, {
                path: '/adminSet',
                component: adminSet,
                meta: ['设置', '管理员设置'],
            }, {
                path: '/sendMessage',
                component: sendMessage,
                meta: ['设置', '发送通知'],
            }, {
                path: '/explain',
                component: explain,
                meta: ['说明', '说明'],
            }]
    }
]

export default new Router({
    routes,
    strict: process.env.NODE_ENV !== 'production',
})
